package com.chixing.controller;

import com.chixing.pojo.Flow;
import com.chixing.service.FlowService;
import com.chixing.util.ServerResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author Wesley
 * @version 1.0
 * @date 2021/10/5 15:34
 */
@Controller
public class FlowController {
    @Autowired
    FlowService flowService;

    //返回回执编号
    @GetMapping("flow/{flowNumber}")
    public ModelAndView getFlowById(@PathVariable("flowNumber") Long flowNumber){
        ServerResponse serverResponse = flowService.getFlowByFlowNum(flowNumber);
        ModelAndView mav = new ModelAndView();
        mav.addObject("flow",serverResponse);
        mav.setViewName("order/six_receipt_number");
        return mav;
    }

}
